﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Serialization;
using OpenFrameworkCore.Serialize;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace OpenFrameworkCore.Controls
{
	/// <summary>
	/// ControlContainer의 Context
	/// </summary>
	[XmlTypeAttribute()]
	public class ControlContainerBaseContext : INotifyPropertyChanged, Serializable
	{
		public event PropertyChangedEventHandler PropertyChanged;

		private ObservableCollection<BasicControlContext> controlContexts;

		/// <summary>
		/// Container에 포함된 control의 context
		/// </summary>
		[XmlElement]
		public ObservableCollection<BasicControlContext> ControlContexts
		{
			get
			{
				return controlContexts;
			}

			set
			{
				controlContexts = value;

				RaisePropertyChanged("ControlContexts");
			}
		}

		/// <summary>
		/// PropertyChanged 이벤트를 발생시킨다.
		/// </summary>
		/// <param name="propertyName"></param>
		protected void RaisePropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}
